def my_write():
    lst = ["anne", "jack", "tom"]
    with open('demo.txt', 'w', encoding='utf-8') as f:
        f.write(','.join(lst))

def my_read():
    with open('demo.txt', 'r', encoding='utf-8') as f:
        s=f.read()
        print(s.split(','))

if __name__ == '__main__':
    my_write()
    my_read()